
// ##############################
// ####  note:  bokeweilai mqtt main fun
// ####  create:  TANWENHUI (twh:谭文辉)
// ####  date:   2024/6/18
// ##############################

#ifndef __BKWL_MQTT_H__
#define __BKWL_MQTT_H__
#include "bk_private/bk_init.h"
#include <components/system.h>
#include <os/os.h>
#include <components/shell_task.h>
#include "cli.h"
#include <stdio.h>

#define BK_RUN_MODE_NORMAL 0
#define BK_RUN_MODE_CALL 1
#define BK_RUN_MODE_NOW BK_RUN_MODE_NORMAL

typedef void (*bkwl_mqtt_recive_cb_t)(const char *topic, char *data_buf, uint32_t data_len);

extern bk_err_t bkwl_mqtt_init();

extern int bkwl_mqtt_client_init(const char *host_name, const char *username, const char *password, const char *topic);
extern int bkwl_mqtt_cmd_msg_send(char *topic, char *msg);

extern int bkwl_mqtt_base_client_init(const char *host_name, const char *username,
                                      const char *password, const char *client_id, const char *topic, bkwl_mqtt_recive_cb_t recive_cb);

#endif
